package com.s2bdatautil;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.ecbt.rest.util.DateUtil;

public class TestFunction {
	public static void main(String[] args) {
		
		System.out.println(longToDate(1539320167000l));
		System.out.println(longToDate(1549720167000l));
		System.out.println(1549720167-1539320167);
//		System.out.println(new Date().getTime());
//		String date = DateUtil.addTimeByMinute("2019-01-24 12:23", -22);
//		System.out.println(date);
		
//		Date d = new Date(1548315194);
//		System.out.println(d);
//		d =  new Date(1543395408);
//		System.out.println(d);
//		Timestamp tt = new Timestamp(1548315194);
//		System.out.println(tt);
		
//		Date date = DateUtil.str2DateCn("2018-01-02 12:12:32");
//		System.out.println(ReadExpressInfo.randomIntRange(0, 3));
//		for (int i = 0; i < 17; i++) {
//			String newdateString = ReadExpressInfo.addTimeBySeconds("2018-01-02 12:12:32", ReadExpressInfo.randomIntRange(1000, 7200000));
//			System.out.println(newdateString + "  " + newdateString.substring(0, 10) + "  " + DateUtil.str2DateCn(newdateString).getTime()/1000);
//		}
	}
	
	public static String longToDate(long lo){    
		Date date = new Date(lo);   
		SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");    
		return sd.format(date);  
		}
}
